ResCompare is a programmer’s utility that compares resource files and their data forks. It can also update the resources that have changed, show detailed differences between two resources, and generate a self–applying patch application that will convert one or more old versions of a file into a target version.
ResCompare requires System 7 or later, plus the Thread Manager. System 7.5 and later versions automatically include Thread Manager; older systems require an Apple–provided extension. Self–applying patches made with ResCompare will run on any system version. ResCompare is a fat application, meaning it runs at native speed on the Power Macintosh. Self–applying patches made with ResCompare are 68K–only, to conserve space and preserve compatibility with older machines.
You should use this program with care. If you don’t understand what a resource is for, learn first; then use this program. As with ResEdit, you can do irreparable damage to a file by changing resources that shouldn’t be changed. This software is a powerful tool; use it with caution. This software comes with no warranty and I am not liable if you damage your resource file with it. Although I have tested the software on several configurations and believe it to be bug–free (or at least bug–light), you, the user, are responsible for any crashes or equipment failure resulting directly or indirectly from its use. Make lots of backups!
How do I use it?
ResCompare is easy to use. Just start it up and choose Open from the File menu. Pick a resource file to look at and ResCompare gives you a list of all the resources within that file. This list is pretty handy because it’s sorted by resource type and ID, and it also contains the name and size of each resource. You can print out the entire list, or you can select some resources and copy the formatted list of information to the clipboard. (Note: If the file has a data fork, it is shown as an additional (but possibly very large) resource. Any operation that you can perform on a resource can be performed on the data fork.)
But the real fun starts when you choose the Compare with command from the File menu. This command lets you open a second resource file, and it compares each resource in the first file (the master file) with the resource having the same type and ID in the second file (the update file).
You can open the update file while the master file is being read. This generally speeds up the comparison process for larger resource files. Under System 7, you can drag any file onto ResCompare. (Note: If you can’t drag files onto ResCompare, try rebuilding your Desktop by restarting with the option and command keys held down.) If the frontmost window is a resource list that hasn’t been compared to anything yet, ResCompare will compare the new file to it. Otherwise, ResCompare will open the new file.
After comparing, the resources that are identical are removed from the list (it doesn’t alter the files). All resources that were deleted from the master file are shown in red, with the “deleted” icon (a left–pointing arrow) on the left margin. Any resources that were added to the update file are shown in green, and get the “added” icon (a right–pointing arrow). Any resources whose contents, attributes or names have changed get the “changed” icon (a double arrow), and are shown in blue. Here’s what a window looks like after comparing two resource files.
You can select resources from this list by clicking them. Use the shift key to extend your selection and the command key to form a discontinuous selection. You can also type a resource’s type and ID to scroll to the closest match and select it. Use Select All from the Edit menu to select all resources at once.
At the top of the window, the names of the master and update files are shown, along with their version numbers and the names of the volumes they reside on. In the Size column, you can see the “before/after” sizes of each resource. The little “no–write” icon (the slashed pencil) is next to the update file to remind you that it cannot be changed. However, the master file doesn’t have a no–write icon. You can change its resources using the Update command in the Change menu.
If you select one or more resources in the list and choose Update, the update is applied to the selected resources. What does that mean? It means that if a resource was added to the update file, it gets added to the master file. A resource that was deleted gets deleted from the master file. A changed resource is copied from the update file to the master file, along with its attributes and resource name. In other words, the selected resources are changed in the master file so that they are identical to the update file. After updating, ResCompare removes the selected resources from the list (since they’re now identical).
If you click the no–write icon, ResCompare swaps the master and update files. This is useful if you want to get some changed resources into your master file, and also put some resources you’ve changed into the update file.
You can also use the Font and Size menus in the usual manner to adjust the font used. You should probably switch to Helvetica before printing to a LaserWriter.
Editing Resources
Select one or more resources and choose Edit resources from the Edit menu. This command opens the master and update resource files in a resource editor (either ResEdit or Resorcerer®) and displays the selected resources. If the resource editor isn’t running, ResCompare will launch it. Use the Choose editor command from the Edit menu to select your preferred resource editor. These commands only work under System 7.
Viewing Resource Differences
ResCompare can show you the exact changes to a resource. After comparing files, select a resource and choose Differences from the Change menu. It may take ResCompare a few moments to compute the resource differences; but when it’s done, ResCompare will display a window like this.
The top portion of the window displays any differences found in the resource name and attributes. Differences in the resource contents are displayed in a hexadecimal format. Identical, inserted, deleted, and changed sections are shown in their respective colors. If you aren’t using a color monitor, you can refer to the byte offsets listed in the two left–hand columns. The left column is the offset within the master file, and the right column is the offset within the update file. A section has been deleted if it has no update offset, and it has been added if it has no master offset. If the section has both offsets, it has been changed if the hex dump is split into two sections. Otherwise, the section is identical in both files. The same information is also displayed in an ASCII dump in the right–hand column.
ResCompare will also show differences if you double–click a resource or select a resource and press return. You can use the Change menu’s Hide same parts command to suppress the display of the identical (black) parts. You can also select any portion of the differences and copy it to the clipboard as text.
To contact me
I hope you enjoy ResCompare. If you like it and find it useful, let me hear from you. If you have any suggestions, questions, or bug reports, send me e–mail at hecht@vnet.net.